<button
  *ixRequiresRoles="[Role.FullAdmin]"
  mat-button
  class="menu-toggle"
  ixTest="manage-configuration-menu"
  [matMenuTriggerFor]="menu"
  [ixUiSearch]="searchableElements.elements.manageConfiguration"
>
  {{ 'Manage Configuration' | translate }}
  <ix-icon name="mdi-menu-down" class="menu-caret"></ix-icon>
</button>

<mat-menu #menu="matMenu">
  <button
    *ixRequiresRoles="[Role.FullAdmin]"
    mat-menu-item
    ixTest="download-configuration"
    [ixUiSearch]="searchableElements.elements.downloadFile"
    (click)="onDownloadConfig()"
  >
    {{ 'Download File' | translate }}
  </button>
  <button
    *ixRequiresRoles="[Role.FullAdmin]"
    mat-menu-item
    ixTest="upload-configuration"
    [ixUiSearch]="searchableElements.elements.uploadFile"
    (click)="onUploadConfig()"
  >
    {{ 'Upload File' | translate }}
  </button>
  @if (isSysAdmin$ | async) {
    <button
      *ixRequiresRoles="[Role.FullAdmin]"
      mat-menu-item
      ixTest="reset-configuration"
      [ixUiSearch]="searchableElements.elements.resetToDefaults"
      (click)="onResetToDefaults()"
    >
      {{ 'Reset to Defaults' | translate }}
    </button>
  }
</mat-menu>
